package com.example.lombok;

import lombok.*;

import java.util.Date;

/**
 * @author shanchong
 * @date 2019-06-23
 **/
@NoArgsConstructor
//@RequiredArgsConstructor
@AllArgsConstructor
@ToString
public class ArgsConstructorDemo {

    private String name;

    private Date createDate;

    private Integer age;

    /**
     * @NoArgsConstructor, @RequiredArgsConstructor and @AllArgsConstructor：用在类上，自动生成无参构造和使用所有参数的构造函数以及把所有@NonNull属性作为参数的构造函数，如果指定staticName = “of”参数，同时还会生成一个返回类对象的静态工厂方法，比使用构造函数方便很多
     * @param args
     */
    public static void main(String[] args) {
        ArgsConstructorDemo argsConstructorDemo = new ArgsConstructorDemo();
        System.out.println(argsConstructorDemo);
        ArgsConstructorDemo argsConstructorDemo1 = new ArgsConstructorDemo("shanchong", new Date(), 1);
        System.out.println(argsConstructorDemo1);
    }



}
